package com.currentcms.client.event;

import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.user.client.ui.Widget;

public class CancelEvent extends GwtEvent<CancelHandler>
{

	private static Type<CancelHandler> TYPE;

	public static Type<CancelHandler> getType()
	{
		if (TYPE == null)
		{
			TYPE = new Type<CancelHandler>();
		}
		return TYPE;
	}

	private Widget _source;

	public CancelEvent(Widget source)
	{
		_source = source;
	}

	public Widget getSource()
	{
		return _source;
	}

	@Override
	public final Type<CancelHandler> getAssociatedType()
	{
		return TYPE;
	}

	@Override
	public String toDebugString()
	{
		assertLive();
		return super.toDebugString();
	}

	@Override
	protected void dispatch(CancelHandler handler)
	{
		handler.onCancelEvent(this);
	}
}
